package com.appoint.common.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @ClassName:  STATE
 * @Description: 状态
 * @author baode
 * @date 2021年2月14日 下午3:01:32
 */
public enum STATE {


	YES("0", "有效"),
    NO("1", "无效"),
    NO_VALIDATA("2", "失效"),
    DELETE("3", "删除");

	private String code;
	private String desc;

	private STATE(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	private static final Map<String, String> MAP = new HashMap<String, String>();
	static {
		for (STATE agentType : EnumSet.allOf(STATE.class)) {
			MAP.put(agentType.getCode(), agentType.getDesc());
		}
	}

	public static String getDesc(String code) {
		return MAP.get(code);
	}
}
